if [ ! -f /etc/yum.repos.d/puppetlabs.repo ]; then
	echo "Adding puppet repo"
	sudo rpm -ivh https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm
else
	echo "Repo already installed"
fi

if grep -q 'puppet-server' `hostname`; then
	package='puppet-server'
else
	package='puppet'
fi

if [ ! -f /usr/bin/puppet ]; then
	echo "installing $package"
	sudo yum install $package -y
else
	echo "$package is already installed"
fi